Repository navigation
fix(deps): declare Pillow so mesh ops keep their textures - #435
Merged
Merged
Conversation
trimesh decodes glTF images with Pillow but does not depend on it. The setup venv therefore had no Pillow, and every op that reloads and re-exports a mesh (presets, transforms, normals) silently wrote it back without its textures. The dev .venv happened to have it, which hid the bug. Changing requirements.txt also changes its hash, so existing installs re-run setup and get Pillow on the next launch.
4 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Prepare for Game (and any op that reloads and re-exports a mesh with trimesh: presets, transforms, normals…) returned the mesh without its textures in the app.
Root cause
trimesh decodes glTF images with Pillow, but Pillow is optional for trimesh and was never listed in
api/requirements.txt. The venv created by setup (<dependenciesDir>/venv) therefore has no Pillow. trimesh then drops every image without raising an error, and the re-exported GLB has bare materials.The dev
api/.venvhappened to have Pillow installed, which is why tests and local checks never caught it.Reproduced with the setup venv on a textured Sketchfab GLB: 8 images in, 0 out. With Pillow on the path: 10 out (textures kept).
Fix
Pillow>=10.0toapi/requirements.txt, with a comment explaining why.api/tests/test_requirements.pychecks that Pillow stays declared.requirements.txtchanges its hash, so existing installs re-run setup and install Pillow on the next launch.